<?php
// file = getPicture.php
include 'dbconnect.php';

$id = (int) $_GET['id'];
$query = "SELECT Photo " .
         "FROM VehicleForSale WHERE VehicleForSaleID = '$id'";
//$sql = "SELECT Photo FROM VehicleForSale WHERE VehicleForSaleID = $id";
// query the db
// store data into var $picData
$photoresult = mysqli_query($mysql, $query);
header("Content-type: img/jpeg");
echo $photoresult;
// Set the content type and print the data.

?>